<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>订单详情</title>
<%@ include file="/page/include.jsp"%>
</head>
<style type="text/css">
.error {
	color: red;
	padding-left: 10px;
}
</style>
<body class="nav-md" style="background-color: #f7f7f7">
	<div class="container body">
		<div class="main_container">
			<div class="row">
				<div class="col-md-12 col-sm-12 col-sx-12">
				
					<input type="hidden"  id="isSalesman" value="${isSalesman}"/>
					<input type="hidden"  id="date" value="${date}"/>
					<div class="dd_part2">
                    	<div class="dd_part2_1">
                        	<p>
                        		订单编号：${order.orderCode }<br/>客户名称：${order.customerName }<br/>客户单位：${order.customerCompanyName }
                            	<c:if test="${order.orderStatus == '06' }">
                            		<br/>取消原因：${order.cancelReason }
                           		</c:if>
                        	</p>
                        	<input type="hidden"  id="order_status"  value="${order.orderStatus}"/>
                            <%-- 待支付的订单可以取消,已驳回的订单可取消 --%>
                            <c:if test="${order.orderStatus == '09' || (order.payModel == '01' && order.orderStatus == '01') || order.orderStatus == '03'}">
                            	<c:if test="${isSalesman eq 0 }">
                            		<h3><input type="button" class="btn btn-danger btn-xs" value="取消订单" onclick="openCancelWin('${order.orderCode }');"/></h3><i></i>
                            	</c:if>
                            </c:if>
                        </div>
                        <c:if test="${order.orderStatus != '06' }">
                        <div class="dd_part2_2">
                        	<div class="dd_step"><s></s>
                        		<fmt:formatNumber var="fmt_orderStatus" value="${order.orderStatus}" pattern="#"/>
                            	<ul>
                                	<li class="a1"><u class="a1"></u>
                                    	<p>
                                        	<i class="icon1"></i>
                                            <span>提交订单</span>
                                        </p>
                                    </li>
                                    <li <c:if test="${order.orderStatus eq '01' }">class="current"</c:if>
                                    	<c:if test="${fmt_orderStatus > 1 }">class="a1"</c:if> 
                                    >
                                    	<p><b></b>
                                        	<i class="icon2"></i>
                                            <span>待付款</span>
                                        </p>
                                    </li>
                                    <li <c:if test="${order.orderStatus eq '02' }">class="current"</c:if>
                                    	<c:if test="${fmt_orderStatus > 2 }">class="a1"</c:if> 
                                    	<c:if test="${fmt_orderStatus < 2 }">class="a2"</c:if> 
                                    >
                                    	<p><b></b>
                                        	<i class="icon3"></i>
                                            <span>待审核</span>
                                        </p>
                                    </li>
                                    <li <c:if test="${order.orderStatus eq '04' }">class="current"</c:if>
                                    	<c:if test="${fmt_orderStatus > 4 }">class="a1"</c:if> 
                                    	<c:if test="${fmt_orderStatus < 4 }">class="a2"</c:if> 
                                    >
                                    	<p><b></b>
                                        	<i class="icon4"></i>
                                            <span>待发货</span>
                                        </p>
                                    </li>
                                    <li <c:if test="${order.orderStatus eq '05' }">class="current"</c:if>
                                    	<c:if test="${fmt_orderStatus > 5 }">class="a1"</c:if> 
                                    	<c:if test="${fmt_orderStatus < 5 }">class="a2"</c:if> 
                                    >
                                    	<p><b></b>
                                        	<i class="icon5"></i>
                                            <span>待收货</span>
                                        </p>
                                    </li>
                                    <li <c:if test="${order.orderStatus eq '07' }">class="current"</c:if>
                                    	<c:if test="${fmt_orderStatus > 7 }">class="a1"</c:if> 
                                    	<c:if test="${fmt_orderStatus < 7 }">class="a2"</c:if> 
                                    >
                                    	<p><b></b>
                                        	<i class="icon6"></i>
                                            <span>完成</span>
                                        </p>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    </c:if>
                    <c:if test="${order.orderStatus == '06' }">
                    <div class="dd_part2_2">
                        	<div class="dd_step2"><s></s>
                            	<ul>
                                	<li class="a1"><u class="a1"></u>
                                    	<p>
                                        	<i class="icon1"></i>
                                            <span>提交订单</span>
                                        </p>
                                    </li>
                                    <li class="current"><u class="a2"></u>
                                    	<p><b></b>
                                        	<i class="icon2"></i>
                                            <span>已取消</span>
                                        </p>
                                    </li>
                                    
                                </ul>
                            </div>
                    </div>
                    </c:if>
				
				</div>
			</div>
			<div class="row" style="margin-top:20px;">
				<div class="framebody" role="main"  style="background-color: #fff;padding-bottom: 20px;">
	                <ul id="myTab" class="nav nav-tabs">
	                    <li ${tabIndex=='1'?'class="active"':''}><a href="#order_base_info" data-toggle="tab">订单信息</a></li>
	                    <li ${tabIndex=='2'?'class="active"':''}><a href="#order_contract_info" data-toggle="tab">合同信息</a></li>
	                    <li ${tabIndex=='3'?'class="active"':''}><a href="#order_pay_confirm_info" data-toggle="tab">收款记录</a></li>
	                    <li ${tabIndex=='4'?'class="active"':''}><a href="#order_send_info" data-toggle="tab">收发货记录</a></li>
	                    <li ${tabIndex=='5'?'class="active"':''}><a href="#order_operation_log" data-toggle="tab">操作流水</a></li>
	                    <li ${tabIndex=='6'?'class="active"':''}><a href="#order_invoice_info" data-toggle="tab">发票信息</a></li>
	                </ul>
	                <!-- 隐藏域 end -->
	                <div id="myTabContent" class="tab-content">
	                    <div class="tab-pane fade ${tabIndex=='1'?'in active':''} " id="order_base_info">
	                    	<div class="row">
	                    		<div class="col-md-12 col-sm-12 col-xs-12">
	                    			<div class="order_detail_info_tips_container">
	                    				<div><span>【收货人信息】</span><span>收货人：${order.receiverName}</span><span style="margin-left:20px;">收货人号码：${order.receiverMobile }</span><span style="margin-left:20px;">收货地址：${order.provinceName}${order.cityName}${order.areaName}${order.address}</span></div>
	                    				<div><span>【备注】</span><span>${order.intro}</span></div>
	                    			</div>
	                    		</div>
	                    	</div>
	                    	<div class="row" style="margin-top:20px;">
	                    		<div class="col-md-12 col-sm-12 col-xs-12" ">
									<input type="hidden"  id="orderCode"  name="orderCode"  value="${orderCode}"/>
									<table id="orderProductDetailTable" class="table"></table>
								</div>
							</div>
							<div class="row" style="margin-top:20px;">
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div  class="order_detail_info_tips_container" style="height: 200px;padding-left:0px;">
	                    				<ul>
	                    					<li><b>温馨提示：</b></li>
	                    					<li>1.1个积分抵1元人民币</li>
	                    					<li>2.费用信用中调价后应付费用为商品总金额-优惠券抵扣金额-积分抵扣金额-订单促销优惠金额-+/-人工调价
	                    					<li>3.调价时，订单需要处于待确认状态且付款状态为未支付</li>
	                    					<li>4.调价时，优惠调价金额为正数时表示降价，为负数时表示提高价格，可以多次调价。</li>
	                    				</ul>
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				商品总金额：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item" >
	                    				￥${order.orderMoney}
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				优惠券抵扣金额：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				
	                    				-￥${order.couponMoney }
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				积分抵扣：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				-￥${order.pointsMoney }
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6" ">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				订单促销优惠：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item" >
	                    				-￥${order.promotionDiscountMoney }
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				运费：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				<c:if test="${order.deliveryFeeMoney < 0 }">
											-￥<fmt:formatNumber type="number" value="${order.deliveryFeeMoney * -1 }" pattern="0.00" />
										</c:if>
										<c:if test="${order.deliveryFeeMoney >= 0 }">
											￥<fmt:formatNumber type="number" value="${order.deliveryFeeMoney}" pattern="0.00" />
										</c:if>
	                    			</div>
	                    		</div>
	                    		
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				商品调价差额：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				<c:if test="${order.adjustProductMoney < 0 }">
											￥<fmt:formatNumber type="number" value="${order.adjustProductMoney * -1 }" pattern="0.00" />
										</c:if>
										<c:if test="${order.adjustProductMoney >= 0 }">
											-￥<fmt:formatNumber type="number" value="${order.adjustProductMoney}" pattern="0.00" />
										</c:if>
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				订单总额调整：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_item">
	                    				<c:if test="${order.adjustOrderMoney < 0 }">
											-￥<fmt:formatNumber type="number" value="${order.adjustOrderMoney * -1}" pattern="0.00" />
										</c:if>
										<c:if test="${order.adjustOrderMoney >= 0 }">
											￥<fmt:formatNumber type="number" value="${order.adjustOrderMoney}" pattern="0.00" />
										</c:if>
	                    			</div>
	                    		</div>
	                    		<div class="col-md-6 col-sm-6 col-xs-6">
	                    			<div class="col-md-6 col-sm-6 col-xs-6"></div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_red" >
	                    				应付：
	                    			</div>
	                    			<div class="col-md-3 col-sm-3 col-xs-3 order_price_red" >
	                    				￥${order.realPayMoney }
	                    			</div>
	                    		</div>
	                    	</div>
	                    </div>
	                    
	                    
	                    <!-- 合同信息begin -->
	                    <div class="tab-pane fade ${tabIndex=='2'?'in active':''}" id="order_contract_info">
	                    
	                    	<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12">
									
									<div class="x_panel">
										<div class="x_content">
											<div class="row" >
												<div class="order_detail_info_tips_container" style="line-height:20px;padding-left:0px;">
				                    				<span>【合同信息】</span>
				                    				<span>待确认合同：</span><span id="wait_to_confirm_contract">0</span>
				                    				<span>已确认合同：</span><span id="confirmed_contract">0</span>
				                    			</div>
											</div>
											<div class="row">
													<div id="img_container" class="col-md-7 col-sm-7 col-xs-7" style="float:left;margin-top:20px;"></div>
													<div class="col-md-5 col-sm-5 col-xs-5" style="margin-top:200px;text-align: left;">
														<c:if test="${order.payModel =='02' && order.orderStatus == '02'}">
															<span>注：合同全部确认，将不能再新增、修改、删除合同附件!</span><br/>
															<c:if test="${isSalesman eq 0}">
																<button id="btn_confirm_order_contract" class="btn btn-danger" >确认合同</button>
															</c:if>
														</c:if>
													</div>
											</div>
										</div>
									</div>
									
								</div>
							</div>
	                        
	                    </div>
	                    <!-- 合同信息 end -->
	                    
	                    
	                    <!-- 付款记录 start-->
	                    <div class="tab-pane fade ${tabIndex=='3'?'in active':''}" id="order_pay_confirm_info">
	                    
	                    	<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12">
									
									<div class="x_panel">
										<div class="x_content">
											<div class="row">
												
											</div>
											<div class="row">
												<table id="orderPayTable" class="table"></table>
											</div>
										</div>
									</div>
									
								</div>
							</div>
	                        
	                    </div>
	                    <!-- 付款记录 end -->
	                    
	                    <!-- 订单发货记录 start -->
	                    <div class="tab-pane fade ${tabIndex=='4'?'in active':''}" id="order_send_info">
	                    	<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12">
									
									<div class="x_panel">
										<div class="x_content">
											<div class="row">
												<div class="order_detail_info_tips_container" style="margin-bottom:10px;">
													<span>【收货人信息】</span>
													<span>收货人：${order.receiverName }</span>
													<span>收货电话：${order.receiverMobile }</span>
													<span>收货地址：${order.provinceName}${order.cityName}${order.areaName}${address}</span>
													<br/>
													<span>【配送信息】</span>
													<span>配送方式：
														<c:if test="${order.deliveryType == '1' }">客户自提</c:if>
														<c:if test="${order.deliveryType == '2' }">普通物流</c:if>
														<c:if test="${order.deliveryType == '3' }">快递物流</c:if>
														<c:if test="${order.deliveryType == '4' }">其它</c:if>
													</span>
													<span>配送要求：<span style="color:#e21918;">${order.deliveryIntro }</span></span>
												</div>
											</div>
											<div class="row">
												<table id="orderProductNotDeliveredTable" class="table"></table>
											</div>
											<%--只在待发货状态下，订单显示确认发货按钮 --%>
											<c:if test="${order.orderStatus =='04' && isSalesman eq 0}">
											<div class="row">
												<input id="btn_confirm_send" type="button" class="btn btn-danger pull-right" style='margin-top:20px;margin-right:-1px;'  value="确认发货"/>
											</div>
											</c:if>
											
											<div class="row">
											<hr/>
											<br/>
											</div>
											<div class="row">
												<table id="orderProductDeliveredTable" class="table"></table>
											</div>
										</div>
									</div>
									
								</div>
							</div>
	                    </div>
	                    <!-- 订单发货记录 end -->
	                    
	                    <!-- 订单操作流水 start -->
	                    <div class="tab-pane fade ${tabIndex=='5'?'in active':''}" id="order_operation_log">
	                    	<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12">
									
									<div class="x_panel">
										<div class="x_content">
											<div class="row">
												<table id="orderLogTable" class="table"></table>
											</div>
										</div>
									</div>
									
								</div>
							</div>
	                    </div>
	                    <!-- 订单操作流水 end -->
	                    
	                    <!-- 发票信息begin -->
	                    <div class="tab-pane fade ${tabIndex=='6'?'in active':''}" id="order_invoice_info">
	                    	<div class="row">
	                    		<div class="col-md-12 col-sm-12 col-xs-12">
	                    			<div class="order_detail_info_tips_container">
	                    				<div>
	                    					<span>【发票类型】</span>
	                    					<span>${order.invoiceTypeName}</span>
	                    				</div>
	                    				<c:if test="${order.invoiceType ne '01'}">
	                    					<c:if test="${order.invoiceType eq '02'}">
	                    						<div>
	                    							<span>【发票抬头】</span>
	                    							<span>${invoice.compnayName}</span>
	                    						</div>
	                    						<div>
	                    							<span>【纳税人识别码】</span>
	                    							<span>${invoice.taxNo}</span>
	                    						</div>
	                    					</c:if>
	                    					<c:if test="${order.invoiceType eq '03'}">
	                    						<div>
	                    							<span>【单位名称】</span>
	                    							<span>${invoice.compnayName}</span>
	                    						</div>
	                    						<div>
	                    							<span>【纳税人识别码】</span>
	                    							<span>${invoice.taxNo}</span>
	                    						</div>
	                    						<div>
	                    							<span>【注册地址】</span>
	                    							<span>${invoice.registeAddress}</span>
	                    						</div>
	                    						<div>
	                    							<span>【开户银行】</span>
	                    							<span>${invoice.openBankName}</span>
	                    						</div>
	                    						<div>
	                    							<span>【银行账号】</span>
	                    							<span>${invoice.bankAccount}</span>
	                    						</div>
	                    					</c:if>
	                    				</c:if>
	                    			</div>
	                    		</div>
	                    	</div>
	                    </div>
	                    <!-- 发票信息 end -->
	                    
	                </div>
	            </div>
			</div>
		</div>
	</div>
<%-- 取消操作弹出框 begin --%>
<div class="modal fade" id="cancelModal" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="cancelModalLabel" aria-hidden="true">
    <form action="#" class="form-horizontal form-label-left">
        <div class="modal-dialog" style="width: 30%;min-height:250px;height:300px;max-height:300px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="cancelModalLabel">订单取消</h4>
                </div>
                <div class="modal-body">
                    <div class="item form-group">
                        <label class="control-label col-md-4"><font color="red">*</font><b>取消原因：</b></label>
                        <div class="col-md-8 padTop8" style="margin-left: -10px;">
                            <select class="selectpicker col-md-12" id="cancelReasonCombo">
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-4"><font color="red">*</font><b>备注：</b></label>
                        <div class="col-md-8">
                            <textarea id="cancelIntro" name="cancelIntro" maxlength="100" class="form-control col-md-10 col-xs-12"></textarea>
                        </div>
                    </div>
                    
                </div>
                <div class="modal-footer">
                    <input type="hidden" id="cancelOrderCode" />
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="javascript: doCancelOrder();">确定取消</button>
                </div>
            </div>
        </div>
    </form>
</div>
<%-- 取消操作弹出框 begin --%>
</body>
<script type="text/javascript" src="${rootPath}/js/order/order_form.js?v=20180123_v1"></script>
</html>